#pragma once

#include "../RHIResource.h"

class AccelerationStructure : public RHIResource
{
public:

	virtual ~AccelerationStructure();

	VkAccelerationStructureTypeKHR GetType() const;

	VkBuildAccelerationStructureFlagsKHR GetFlags() const;

	VkBuffer& GetAccelerationStructureBuffer();

	VkDeviceMemory& GetAccelerationStructureMemory();

	VkAccelerationStructureKHR& GetAccelerationStructure();

protected:

	void CreateAccelerationStructureBuffer(VkDeviceSize size, VkBuffer& buffer, VkDeviceMemory& deviceMemory);

	void CreateScratchBuffer(VkDeviceSize size, VkBuffer& buffer, VkDeviceMemory& deviceMemory, VkDeviceAddress& deviceAddress);

protected:

	VkAccelerationStructureTypeKHR mType;

	VkBuildAccelerationStructureFlagsKHR mFlags;

	VkBuffer mAccelerationStructureBuffer;

	VkDeviceMemory mAccelerationStructureMemory;

	VkAccelerationStructureKHR mAccelerationStructure;

};